package com.jilefojing.service;

import java.util.List;

import com.jilefojing.beans.enums.ProgressStatusForSource;
import com.jilefojing.beans.exception.UserContextException;
import com.jilefojing.beans.pojos.EVideo;
import com.jilefojing.beans.pojos.enhanced.EnhancedDCategory;
import com.jilefojing.beans.pojos.enhanced.EnhancedEVideo;
import com.jilefojing.beans.pojos.enhanced.base.BaseEnhanced;
import com.jilefojing.beans.query.EVideoQuery;
import com.jilefojing.beans.vo.Pagination;
import com.jilefojing.beans.vo.UploadFile;
import com.jilefojing.context.beans.vo.UserContext;
import com.jilefojing.service.base.IBaseService;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年07月19日 13时23分08秒
 */
public interface IEVideoService extends IBaseService<EVideo> {

	/**
	 * 取类别的交集
	 * 
	 * @param categoryIds
	 * @param progressStatuses
	 * @param pagination
	 * @param userContext
	 * @return
	 */
	Pagination<EnhancedEVideo> getPaginationByCategoryIdsForActive(List<Long> categoryIds, List<ProgressStatusForSource> progressStatuses, Pagination<EnhancedEVideo> pagination,
			UserContext userContext);

	Pagination<EnhancedEVideo> getPaginationByTagIdForActive(long tagId, Pagination<EnhancedEVideo> pagination, UserContext userContext);

	Pagination<EnhancedEVideo> getPagination(EVideoQuery eVideoQuery, Pagination<EnhancedEVideo> pagination, UserContext userContext);

	List<? extends BaseEnhanced> getEnhanceds(List<Long> ids, UserContext userContext);

	List<EnhancedEVideo> getEnhancedsNotAppend(List<Long> ids, UserContext userContext);

	EnhancedEVideo appendEnhancedStatistics(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendEnhancedStatistics(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	EnhancedEVideo appendEnhancedParent(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendEnhancedParent(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	EnhancedEVideo appendEnhancedChildren(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendEnhancedChildren(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	EnhancedEVideo appendCountCognate(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendCountCognate(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	List<EnhancedEVideo> getEnhancedsByParentId(long parentId, UserContext userContext);

	List<EnhancedEVideo> getEnhancedsByParentIds(List<Long> parentIds, UserContext userContext);

	EnhancedEVideo getEnhancedForActive(long id, UserContext userContext) throws UserContextException;

	List<EnhancedEVideo> appendCountCognatePlaytime(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	EnhancedEVideo appendEnhancedUsers(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendEnhancedUsers(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	EnhancedEVideo appendEnhancedAttitudeForUser(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendEnhancedAttitudeForUser(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	EnhancedEVideo appendEnhancedRFavoriteSourceForUser(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendEnhancedRFavoriteSourceForUser(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	EnhancedEVideo appendEnhancedTags(EnhancedEVideo enhancedEVideo, UserContext userContext);

	List<EnhancedEVideo> appendEnhancedTags(List<EnhancedEVideo> enhancedEVideos, UserContext userContext);

	List<EnhancedDCategory> getEnhancedDCategories(UserContext userContext);

	/**
	 * 上传视频源
	 * 
	 * @param eVideo
	 * @param userContext
	 * @return
	 * @throws UserContextException
	 */
	EVideo add(EVideo eVideo, UserContext userContext) throws UserContextException;

	/**
	 * 只更新 title sort playtime summary info status
	 * 
	 * @param eVideo
	 * @param userContext
	 * @return
	 * @throws UserContextException
	 */
	EVideo update(EVideo eVideo, UserContext userContext) throws UserContextException;

	/**
	 * 只更新封面
	 * 
	 * @param id
	 * @param coverUploadFile
	 * @param userContext
	 * @return
	 * @throws UserContextException
	 */
	EVideo updateCover(long id, UploadFile coverUploadFile, UserContext userContext) throws UserContextException;

	/**
	 * 
	 * @param childId
	 * @param parentId
	 * @param optype
	 *            true增加关系 false删除关系
	 * @param userContext
	 * @return
	 */
	EVideo updateRelation(long childId, long parentId, boolean optype, UserContext userContext) throws UserContextException;

}
